#ifndef GWIDGETPIPE_H
#define GWIDGETPIPE_H

#include <QtGui>
#include "gwidget_global.h"

class GRAPHWIDGETSHARED_EXPORT GWidgetPipe : public QWidget
{
Q_OBJECT
public:
	enum GWidgetPipeTye
	{
		GWIDGET_PIPE_TYPE_VERTICAL		=0,
		GWIDGET_PIPE_TYPE_HORIZONTAL,
		GWIDGET_PIPE_TYPE_HEAD,
		GWIDGET_PIPE_TYPE_ZHIJIAO,
		GWIDGET_PIPE_TYPE_YUANJIAO,
		GWIDGET_PIPE_TYPE_T,
		GWIDGET_PIPE_TYPE_SHIZI,
		GWIDGET_PIPE_TYPE_COUNT
	};
	enum GWidgetPipeRotate
	{
		GWIDGET_PIPE_ROTATE_UP			=0,
		GWIDGET_PIPE_ROTATE_DOWN,
		GWIDGET_PIPE_ROTATE_LEFT,
		GWIDGET_PIPE_ROTATE_RIGHT
	};
    explicit GWidgetPipe(QWidget *parent = 0);
	static GWidgetPipe*	CopyWidget(GWidgetPipe *w);
	void				setWidgetRealTime(bool b);
	void				ConfigWidget();

	int					m_pipetype;		
	int					m_piperotate;
	QString				m_outclr;
	QString				m_inclr;
protected:
	void				paintEvent(QPaintEvent* e);
	void				resizeEvent(QResizeEvent* e);
private:
	void				DrawPipeHead(QPainter& painter);
	void				DrawPipeVertical(QPainter& painter);
	void				DrawPipeHorizontal(QPainter& painter);
	void				DrawPipeZhijiao(QPainter& painter);
	void				DrawPipeYuanjiao(QPainter& painter);
	void				DrawPipeT(QPainter& painter);
	void				DrawPipeShizi(QPainter& painter);

	bool				m_bRealTime;
signals:

public slots:

};

#endif // GWIDGETPIPE_H
